<template>
  <div>
    <van-tree-select
      :items="items"
      :active-id.sync="activeId"
      :main-active-index.sync="activeIndex"
    >
      <template #content>
        <div v-if="activeIndex==1" v-for="item in categoryList" :key="item.id">
            123
        </div>
      </template>
    </van-tree-select>
  </div>
</template>
<script>
import { GetCataLog ,Getcategory,GetList} from "@/request/api";
export default {
  data() {
    return {
      items: [],
      categoryList: [], //分类数组
      activeId: 0,
      activeIndex: 0,
      subCategoryList:[],
    };
  },
  created() {
      //左侧栏数据获取
    GetCataLog().then((res) => {
      let { categoryList } = res.data;
      this.categoryList = categoryList
      let arr = [];
      categoryList.map((item) => {
        arr.push({ text: item.name });
      });
      this.items = arr;
      console.log(res);
    });
    Getcategory({
        id:1005001
    }).then(res=>{
        console.log(res)
    })

    GetList({
        id:1005001
    }).then(res=>{
        console.log(res)
    })
  },
};
</script>
<style lang="less"  scoped>
.van-tree-select {
  height: 100vh !important;
}
</style>